Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Filter API errors #155

Merged
merged 2 commits into from
Nov 8, 2023
Merged

[FIX] Filter API errors #155

merged 2 commits into from
Nov 8, 2023

Conversation

AzulGarza
Copy link
Member

Before this PR, tenacity was invoked when errors different than ApiError from httpx were raised. However, when the endpoint is momentarily unavailable, the client often raises an ApiError with a text body. See:

raise ApiError(status_code=_response.status_code, body=_response.text)

This behavior can be used as a proxy for the unavailability of the endpoint. If the endpoint is available but has a server error, the endpoint should return a JSON-decodable response, and a text response otherwise.

This approach was implemented in this PR and tested with a couple of tests ensuring retrying with a response of this kind and providing no retrying when the server responds in a JSON-decodable manner.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

github-actions bot commented Nov 8, 2023

Experiment 1: air-passengers

Description:

variable experiment
h 12
season_length 12
freq MS
level None
n_windows 1

Results:

metric TimeGPT SeasonalNaive Naive
mae 12.6793 47.8333 76
mape 0.027 0.0999 0.1425
mse 213.936 2571.33 10604.2
total_time 6.8936 6.9454 0.7124

Plot:

Experiment 2: air-passengers

Description:

variable experiment
h 24
season_length 12
freq MS
level None
n_windows 1

Results:

metric TimeGPT SeasonalNaive Naive
mae 58.1031 71.25 115.25
mape 0.1257 0.1552 0.2358
mse 4040.21 5928.17 18859.2
total_time 7.3132 0.0043 0.0038

Plot:

Experiment 3: electricity-multiple-series

Description:

variable experiment
h 24
season_length 24
freq H
level None
n_windows 1

Results:

metric TimeGPT SeasonalNaive Naive
mae 4.8617 5.6289 5.2381
mape 0.6816 0.7654 0.6328
mse 40.5749 63.023 50.8454
total_time 3.1976 0.0091 0.0085

Plot:

Experiment 4: electricity-multiple-series

Description:

variable experiment
h 168
season_length 24
freq H
level None
n_windows 1

Results:

metric TimeGPT SeasonalNaive Naive
mae 8.3102 9.3176 12.6464
mape 1.382 1.0786 1.4208
mse 165.13 202.596 336.086
total_time 3.4863 0.0102 0.0097

Plot:

Experiment 5: electricity-multiple-series-with-ex-vars

Description:

variable experiment
h 24
season_length 24
freq H
level None
n_windows 1

Results:

metric TimeGPT SeasonalNaive Naive
mae 5.5206 5.6289 5.2381
mape 0.4674 0.7654 0.6328
mse 40.9623 63.023 50.8454
total_time 2.6966 0.7141 0.5022

Plot:

Experiment 6: electricity-multiple-series-with-ex-vars

Description:

variable experiment
h 168
season_length 24
freq H
level None
n_windows 1

Results:

metric TimeGPT SeasonalNaive Naive
mae 7.5605 9.3176 12.6464
mape 1.371 1.0786 1.4208
mse 135.78 202.596 336.086
total_time 4.1506 0.0117 0.0113

Plot:

@AzulGarza AzulGarza merged commit 7cadf58 into main Nov 8, 2023
12 checks passed
@AzulGarza AzulGarza deleted the fix/filter-api-errors branch November 8, 2023 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant